package ar.com.sectorwine.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import ar.com.sectorwine.entities.Empresa;

public interface EmpresaRepository  extends JpaRepository<Empresa, Long> {
	
	
	@Query("SELECT e FROM Empresa e INNER JOIN e.productos s WHERE s.id = :idStock")
	Empresa obtenerEmpresaPorStock(@Param("idStock") Long idStock);

}
